package com.chujian.framework.util.mybatis.wrapper;

import com.chujian.framework.core.tsdata.TsDataConst;

import java.util.Arrays;
import java.util.List;

public class OperateInWrapperBuilder implements IOperateWrapperBuilder {

    @Override
    public boolean build(WrapperUnit unit) {
        if (TsDataConst.QUERY_BETWEEN_SUFFIX_IN.equals(unit.operate)) {
            String[] parts = unit.value.toString().split(",");
            List<String> ins = Arrays.asList(parts);
            unit.wrapper.in(unit.col, ins);
            return true;
        }
        return false;
    }

}
